import http from "@/assets/js/http";

export default {
    urlFind: '/wms/admin/OutLog/get',
    urlFindToEdit: '/wms/admin/OutLog/get',
    urlFindBy: '/wms/admin/OutLog/list',
    urlSave: '/wms/admin/OutLog/save',
    //urlDelete: '/wms/admin/OutLog/delete',
    //urlDeleteAll: '/wms/admin/OutLog/delete_many',
    urlDelete: '/wms/admin/OutLog/destroy',
    urlDeleteAll: '/wms/admin/OutLog/destroy_many',
    urlCopy: '/wms/admin/OutLog/copy',
    urlEditMany: '/wms/admin/OutLog/edit_many',
    urlTree: '/wms/admin/OutLog/tree',
    urlChoice: '/wms/admin/OutLog/choice',
    find(id, func) {
        http.get(this.urlFind, {id}, res => {
            func(res)
        })
    },
    findToEdit(id, func) {
        http.get(this.urlFindToEdit, {id}, res => {
            func(res)
        })
    },
    findBy(param, func) {
        http.post(this.urlFindBy, param, res => {
            func(res.data.lists, res.data.query)
        })
    },
    save(data, func) {
        http.post(this.urlSave, data, res => {
            func(res)
        })
    },
    delete(id, func) {
        http.get(this.urlDelete, {id}, res => {
            func(res)
        })
    },
    deleteAll(ids, func) {
        http.post(this.urlDeleteAll, {ids}, res => {
            func(res)
        })
    },
    copy(ids, func) {
        http.post(this.urlCopy, {ids}, res => {
            func(res)
        })
    },
    editMany(ids, data, func) {
        http.post(this.urlEditMany, {
            ids,
            _action: data
        }, res => {
            func(res)
        })
    },
}